home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_dunedoor.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  176 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_dunedoor.cog
  4. #    
  5. # Door from the undertunnel to the dune floor
  6. #
  7. # [RKD]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ========================================================================================
  11. symbols
  12. message    startup
  13. message    activated
  14. message    boarded
  15. message    unboarded
  16.  
  17. # world things
  18. thing    button
  19. thing    door
  20. thing    player    local    nolink
  21. thing    jeep
  22.  
  23. # camera things and extoffsetthings
  24. thing    doorcam            nolink
  25. thing    buttoncam        nolink
  26.  
  27. # camera look things, extoffset things, et al
  28. thing    doorcamlook        nolink
  29. thing    buttoncamlook    nolink
  30.  
  31. # dynamic lights
  32. thing    dynalight        nolink
  33. thing    dynalight2        nolink
  34.  
  35. # surface
  36. surface    sandfloor        nolink
  37.  
  38. # sounds
  39. sound    platsnd=nub_2mstep_move_c.wav    local
  40. sound    platmove=teo_gears_slide_c.wav    local
  41. sound    platstop=nub_weight_stop_c.wav    local
  42.  
  43. # variables
  44. int        cursound=0        local
  45.  
  46. # subroutines
  47. flex    fixcams=0.0        local
  48. flex    startscene=0.0    local
  49. flex    endscene=0.0    local
  50. flex    pushbutton=0.0    local
  51. flex    movedoor=0.0    local
  52. end
  53.  
  54. code
  55. startup:
  56.     Sleep(.01);
  57.     
  58.     SetThingLight(door, '5 5 8', 0.001, 0.01);
  59.     SetThingLight(button, '25 25 40', 0.001, 0.01);
  60.  
  61.     ClearAdjoinFlags(sandfloor, 0x1);
  62.     ClearAdjoinFlags(sandfloor, 0x2);
  63.     SetFaceGeoMode(sandfloor, 4);
  64.     ClearAdjoinFlags(GetSurfaceAdjoin(sandfloor), 0x1);
  65.     ClearAdjoinFlags(GetSurfaceAdjoin(sandfloor), 0x2);
  66.     SetFaceGeoMode(GetSurfaceAdjoin(sandfloor), 4);
  67.  
  68.     return;
  69.  
  70. boarded:
  71. # ---> jeep
  72.     
  73.     # keep jeep from falling into hole
  74.     ClearAdjoinFlags(sandfloor, 0x2);
  75.     return;
  76.  
  77. unboarded:
  78. # ---> jeep
  79.  
  80.     # if button is pushed in, allow entry into hole
  81.     if (GetCurFrame(button) == 1)
  82.     {
  83.         SetAdjoinFlags(sandfloor, 0x2);
  84.         return;
  85.     }
  86.  
  87.     
  88. activated:
  89. # ---> button
  90.     
  91.     if (GetSenderRef() != button) return;
  92.     if (GetCurFrame(button) == 1) return;
  93.  
  94.     player = GetLocalPlayerThing();
  95.     DeselectWeaponWait(player);
  96.     
  97.     call fixcams;
  98.     call startscene;
  99.     call pushbutton;
  100.     call movedoor;
  101.     call endscene;
  102.     
  103.     return;
  104.  
  105. pushbutton:
  106.     SetExtCamOffsetToThing(buttoncam);
  107.     PlayMode(player, 60, 0);
  108.     Sleep(.25);
  109.     MoveToFrame(button, 1, 2);
  110.     Sleep(1);
  111.     return;
  112.  
  113. movedoor:
  114.     SetAdjoinFlags(sandfloor, 0x1);
  115.     SetAdjoinFlags(sandfloor, 0x2);
  116.     SetFaceGeoMode(sandfloor, 0);
  117.     SetAdjoinFlags(GetSurfaceAdjoin(sandfloor), 0x1);
  118.     SetAdjoinFlags(GetSurfaceAdjoin(sandfloor), 0x2);
  119.     SetFaceGeoMode(GetSurfaceAdjoin(sandfloor), 0);
  120.     
  121.     SetCameraFocus(2, doorcam);
  122.     SetCameraSecondaryFocus(2, doorcamlook);
  123.     SetCurrentCamera(2);
  124.     sleep(.1);
  125.     
  126.     # move door
  127.     MoveToFrame(door, 1, .5);
  128.     PlaySoundThing(platsnd, door, 1, -1, -1, 0);
  129.     cursound = PlaySoundThing(platmove, door, 1, -1, -1, 1);
  130.  
  131.     # move camera and lookthing
  132.     MoveToFrame(doorcam, 1, .75);
  133.     MoveToFrame(doorcamlook, 1, .75);
  134.     
  135.     # brighten up the place
  136.     SetThingLight(dynalight, '100 87 75', .2, 2);
  137.     SetThingLight(dynalight2, '100 87 75', .05, 2);
  138.     
  139.     WaitForStop(door);
  140.     StopSound(cursound, .5);
  141.     PlaySoundThing(platstop, door, 1, -1, -1, 0);
  142.     Sleep(1);
  143.     return;
  144.  
  145. startscene:
  146.     call fixcams;
  147.     StartCutscene(1);
  148.     StopThing(player);
  149.     SetActorFlags(player, 0x200000);
  150.     
  151.     return;
  152.     
  153. endscene:
  154.     call fixcams;
  155.  
  156.     ClearActorFlags(player, 0x200000);
  157.     SetCurrentCamera(1);
  158.     sleep(.3);
  159.     RestoreExtCam();
  160.     
  161.     EndCutscene();
  162.     
  163.     return;
  164.     
  165. fixcams:
  166.     #reset camera settings
  167.     ResetCameraFOV(0, 0);
  168.     SetCameraPosInterp(2, 0);
  169.     SetCameraLookInterp(2, 0);
  170.     SetCameraPosInterp(1, 0);
  171.     SetCameraLookInterp(1, 0);
  172.     return;
  173.     
  174. end
  175.  
  176.